{% extends "base.html" %}
{% block content_header %}
<h1>系统功能</h1>
{% endblock %}
{% block content_body %}
{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="callout callout-warning">
    <ul>
        {% for message in messages %}
        <li><h4>{{ message }}</h4></li>
        {% endfor %}
    </ul>
</div>
{% endif %}
{% endwith %}
    <div class="box">
            <div class="box-header">
              <h3 class="box-title">应用商店</h3>
            </div>
            <div class="box-body">
              <p>应用商店</p>
                {% for store in store_list %}
                    <a class="btn btn-app" href="/store/{{  store.store_id  }}"><i class="{{ store.store_icon }}"></i>{{ store.store_name }}</a>
                {% endfor %}
                <a class="btn btn-app" data-toggle="modal" data-target="#store-create-modal"><i class="fa fa-plus"></i>添加应用商店</a>
    </div>
    </div>
     <div class="modal fade" role="dialog" id="store-create-modal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <form action="/appstore/create" method="post">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">×</span></button>
                        <h4 class="modal-title">添加应用商店</h4>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <label for="store_name">应用商店名称</label>
                            <input type="text" name="store_name" id="store_name" class="form-control"
                                   placeholder="系统名称">
                        </div>
                         <div class="form-group">
                            <label for="store_icon">商店icon</label>
                            <input type="text" name="store_icon" id="store_icon" class="form-control"
                                   placeholder="商店icon">
                        </div>
                             <div class="form-group">
                            <label for="store_url">搜索链接</label>
                            <input type="text" name="store_url" id="store_url" class="form-control"
                                   placeholder="搜索链接">
                        </div>
                                    <div class="form-group">
                            <label for="web_site">官网地址</label>
                            <input type="text" name="web_site" id="web_site" class="form-control"
                                   placeholder="官网地址">
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
                        <button type="submit" class="btn btn-primary">添加</button>
                    </div>
                </form>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->

    </div>
{% endblock %}

